package com.acwebsitedesign.uRateDrugs.domain;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("DrugService")
public class DrugServiceImpl implements DrugService {

	@Autowired()
	private DrugRepository drugRepository;

	public List<Drug> getDrugByName(String name) {
		return drugRepository.getDrugByName(name);
	}
	
	public List<Drug> getDrugByAlias(String name) {
		return drugRepository.getDrugByAlias(name);
	}
	
	public List<Drug> getDrugLike(String name) {
		return drugRepository.getDrugLike(name);
	}

	public void saveDrug(Drug drug) {
		drugRepository.saveDrug(drug);
	}

	public void removeDrugById(int id) {
		drugRepository.removeDrugById(id);
	}

	public void removeDrugByName(String name) {
		drugRepository.removeDrugByName(name);
	}

	public List<Drug> getDrugById(int id) {
		return drugRepository.getDrugById(id);
	}

	public void saveDrugAlias(Drug drug, String alias) {
		drugRepository.saveDrugAlias(drug, alias);
	}
	
	

}
